import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../Login.vue'
import Content from '../views/myCenter/Content.vue'
import projectList from '../views/myProject/projectList.vue'
import main from '../views/main.vue'
import pwdReset from '../views/pwdReset.vue'
import Joke from '../views/myCenter/Joke.vue'
import weather from '../views/myCenter/weather.vue'
import expert from '../views/myCenter/expert.vue'
import addExpert from '../views/myCenter/addExpert.vue'
import editorExpert from '../views/myCenter/editorExpert.vue'
import CheckExpert from '../views/myCenter/CheckExpert.vue'
import index from '../views/myIndex/index.vue'
import tzgg from '../views/myIndex/tzgg.vue'
import bottom from '../views/myIndex/bottom.vue'
import message from '../views/myIndex/message.vue'
import register from '../views/myIndex/register.vue'
import newsdongtai from '../views/myIndex/newsdongtai.vue'
import tuijianwenzhang from '../views/myIndex/tuijianwenzhang.vue'

import IndexH from "../views/loginH/IndexH.vue"
import grzx from '../views/loginH/grzx.vue'
import xgmm from "../views/loginH/xgmm";
import wyfb from "../views/loginH/wyfb";
import cgx from "../views/loginH/cgx";
Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		redirect: '/index'
	},
	{
		path: '/index',
		name: 'index',
		component: index,
		redirect: '/index/bottom',
		children: [
			{
				path: 'bottom',
				name: 'bottom',
				component: bottom,
			},
			{
				path: 'tzgg',
				name:'tzgg',
				component: tzgg,
			},
			{
				path: 'newsdongtai',
				name:'newsdongtai',
				component: newsdongtai,
			},
			{
				path: 'tuijianwenzhang',
				name:'tuijianwenzhang',
				component: tuijianwenzhang,
			},
			{
				path: 'message',
				name:'message',
				component: message,
			},
			{
				path: 'register',
				name:'register',
				component: register,
			},
		]
	},
	{
		path: '/loginH',
		component: IndexH,
		children: [
			{
					path: 'grzx',
					component: grzx
			},
			{
					path: 'xgmm',
					component: xgmm
			},
			{
					path: 'wyfb',
					component: wyfb
			},
			{
					path: 'cgx',
					component: cgx
			},

		]
	},
	{
		path: '/mycenter',
		component: main,
		children: [{
			path: 'Content',
			component: Content
		},
			{
				path: 'CheckExpert',
				component: CheckExpert
			}
			,
			{
				path: 'editorExpert',
				component: editorExpert
			},
			{
				path: 'expert',
				component: expert
			},
			{
				path: 'Joke',
				component: Joke
			},
			{
				path: 'weather',
				component: weather
			},
			{
				path: 'addExpert',
				component: addExpert
			},
		]
	},
	// {
	// 	path: '/IndexH',
	// 	name: 'IndexH',
	// 	component: IndexH
	// },
	{
		path: '/Login',
		name: 'Login',
		component: Login
	},

	{
		path: '/PwdReset/:id/:username',
		name: 'pwdReset',
		component: pwdReset
	},


	{
		path: '/myProject',
		component: main,
		children: [{
				path: 'list',
				component: projectList
			},

		]
	},

	{
		path: '/about',
		name: 'About',
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () => import( /* webpackChunkName: "about" */ '../views/About.vue')
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
